import 'package:flutter/cupertino.dart';
import 'package:page_transition/page_transition.dart';

extension ContextExtension on BuildContext {
  void push(
    Widget page, {
    PageTransitionType transitionType = PageTransitionType.rightToLeft,
  }) {
    Navigator.push(
      this,
      PageTransition(
        type: transitionType,
        alignment: const Alignment(1, -1),
        duration: const Duration(milliseconds: 200),
        child: page,
      ),
    );
  }

  void back() {
    Navigator.pop(this);
  }
}
